package com.sec.android.app.myfiles.feature;

import android.app.Activity;
import android.view.View;

import com.sec.android.app.myfiles.feature.smarttip.SmartTipImp;

/**
 * Created by eungho78.lee on 2017-05-29.
 */

public class SmartTipMgr {
    private static SmartTipMgr sInstance;
    private SmartTipImp mSmartTipImp;

    public static final int SHOW_SMART_TIP = 0;
    public static final int SCROLL_FULL_UP = 1;
    public static final int SCROLL_UP_IN_PORTRAIT_MODE = 1;
    public static final int SCROLL_UP_IN_LANDSCAPE_MODE = 2;

    public static final int SCROLL_UP_DELAY_TIME = 200;
    public static final int SHOW_SMART_TIP_DELAY_TIME = 400;

    public static SmartTipMgr getInstance(Activity activity) {
        if (sInstance == null) {
            sInstance = new SmartTipMgr(activity);
        }
        return sInstance;
    }

    public static void clearInstance() {
        sInstance = null;
    }

    private SmartTipMgr(Activity activity) {
        if (SmartTipImp.isSmartTipIncluded()) {
            mSmartTipImp = new SmartTipImp(activity);
        }
    }

    public void createSmartTipPopup(View view, int priority) {
        if (mSmartTipImp != null) {
            mSmartTipImp.createSmartTipPopup(view, priority);
        }
    }

    public void clearSmartTipPopup() {
        if (mSmartTipImp != null) {
            mSmartTipImp.clearSmartTipPopup();
        }
    }

    public void saveSmartTipTypeBeforeRotate() {
        if (mSmartTipImp != null) {
            mSmartTipImp.saveSmartTipTypeBeforeRotate();
        }
    }

    public void saveSmartTipStateBeforeRotate() {
        if (mSmartTipImp != null) {
            mSmartTipImp.saveSmartTipStateBeforeRotate();
        }
    }
}
